<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 引包 -->
    <script src="../js/vue.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        div {
            width: 100px;
            height: 100px;
            margin: 20px 0px;
        }

        .red {
            background: red;
        }

        .orange {
            background: orange;
        }

        .yellow {
            background: yellow;
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="red"    v-if=" show=='red' "></div>
        <div class="orange" v-else-if="show=='orange' "></div>
       
        <div class="yellow" v-else></div>
    </div>
</body>

</html>
<script>
    //关联VM
    const VM = new Vue({
        el: '#app',
        data: {
            show: 'orange'
        }
    });
   
</script>